package event;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

/**
 * @program: javaLearn
 * @description:
 * @author: renhai
 * @Date ：2021/12/24 15:26
 **/
public class MyMouseListener implements MouseListener {

    Container c;

    public MyMouseListener(Container c) {
        this.c = c;
    }

    @Override
    public void mouseClicked(MouseEvent e) {

    }

    @Override
    public void mousePressed(MouseEvent e) {

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {
        c.setBackground(Color.pink);
    }

    @Override
    public void mouseExited(MouseEvent e) {
        c.setBackground(Color.blue);
    }
}
